import JsBigDecimal from 'js-big-decimal'

export function add(x,y,precision=2){
    return JsBigDecimal.round(JsBigDecimal.add(x,y),precision,JsBigDecimal.RoundingModes.HALF_UP)
}
export function multiply(x,y,precision=2){
    return JsBigDecimal.round(JsBigDecimal.multiply(x,y),precision,JsBigDecimal.RoundingModes.HALF_UP)
}
export function divide(x,y,precision=2){
    return JsBigDecimal.round(JsBigDecimal.divide(x,y),precision,JsBigDecimal.RoundingModes.HALF_UP)
}
export function subtract(x,y,precision=2){
    return JsBigDecimal.round(JsBigDecimal.subtract(x,y),precision,JsBigDecimal.RoundingModes.HALF_UP)
}